package top.dark.design.patterns.factory.simplefactory;

/**
 * Author: Darkn
 * description:
 * Create Time: 2021/4/22 15:30
 */
public class SimpleFacotry {

    public Pizza createPizza(String pizzaType){
        Pizza pizza = null;
        if (pizzaType.equals("Greek")) {
            pizza = new GreePizza();
            pizza.setName("希腊披萨");
        } else if (pizzaType.equals("Chesse")) {
            pizza = new ChessePizza();
            pizza.setName("芝士披萨");
        }
        return pizza;
    }

}
